package com.project.dao;

import com.project.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    // 根据username查询
    User selectByUserName(String username);

//    根据账号、密码查询
//    User selectByUserInfo(String username, String password);

    // 查找全部用户
    List<User> selectAll(User user);

    /**
     * author: WheelChen
     * date: 2017/8/8
     * function: 检查手机号码是否存在
     *
     * @param mobilePhone 手机号码
     * @return
     */
    int checkMobilePhoneIsExist(@Param("mobilePhone")String mobilePhone);

    /**
     * author: WheelChen
     * date: 2017/8/8
     * function: 检查是否用户名是否存在
     *
     * @param username
     * @return
     */
    int checkUsernameIsExist(@Param("username") String username);

    /**
     * author: WheelChen
     * date: 2017/9/18
     * function: 根据idList批量删除
     *
     * @param idList
     * @return
     */
    int deleteBatchByIdList(List idList);

}